<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/admin.css" media="all">
</head>
<body>

	<div class="layui-fluid">
	<div class="layui-card">

	<div class="layui-form-header">
		<div class="header-left">
		  <div class="layui-inline">
			  <a class="layui-btn layuiadmin-btn-list ajax_del" href="{:url('clearLog')}" data-type="add">清空半年前日志</a>
		  </div>     		   
		</div>
		
		<div class="header-right">
			<form action="{:url()}" method="get">
          <div class="layui-inline">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline">
              <input type="text" name="start_time" value="{$Request.param.start_time}" autocomplete="off" class="layui-input" id="test-laydate-start" placeholder="开始日期">
            </div>

			<div class="layui-input-inline">
				<input type="text" name="end_time" value="{$Request.param.end_time}" autocomplete="off" class="layui-input" id="test-laydate-end" placeholder="结束日期">
			</div>						  
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
              <input type="text" name="username" value="{$Request.param.username}" placeholder="" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">IP地址</label>
            <div class="layui-input-inline">
              <input type="text" name="ip" value="{$Request.param.ip}" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
          </div>
			</form>		   
		</div>	
	
	</div>

	<div class="layui-card-body">
	<form class="layui-form"  lay-filter="component-form-element">
	<table class="layui-table">
	  <colgroup>
		<col width="150">
		<col width="150">
		<col width="200">
		<col>
	  </colgroup>
	  <thead>
		<tr>
		  <th width="10%">ID</th>
		  <th>用户名</th>
		  <th>登录时间</th>
		  <th>登录IP</th>
		  <th>状态</th>
		</tr> 
	  </thead>
	  <tbody>
	  {foreach $data as $key=>$v}
		<tr>
		  <td style="text-align: center;">{$v.id}</td>
		  <td class="center tab-title">{$v.username}</td>          
		  <td class="center"><?=date("Y-m-d H:i:s",$v['addtime'])?></td>
		  <td class="center">{$v['ip']}</td>     
		  <td class="center"><span class="layui-badge {$v['status']?'layui-bg-green':''}">{$v.note}</span></td>   
  
		</tr>
  
	   {/foreach}
	  </tbody>
	</table>  
	<div class="listpage">{$pagelist|raw}</div>
	</form>				  
	</div>
      
	</div>
</div>

  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  <script>
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'laydate'], function(){
    var laydate = layui.laydate;
    
    //示例代码
    
    //开始日期
    var insStart = laydate.render({
      elem: '#test-laydate-start'
      ,done: function(value, date){
        //更新结束日期的最小日期
        insEnd.config.min = lay.extend({}, date, {
          month: date.month - 1
        });
        //自动弹出结束日期的选择器
       insEnd.config.elem[0].focus();
      }
    });
    
    //结束日期
    var insEnd = laydate.render({
      elem: '#test-laydate-end'
      ,min: 0
    });

  });
  </script>

</body>
</html>
